from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
# 启动驱动
driver=webdriver.Firefox()
# 访问网址
driver.get('http://10.59.9.14:7003/')
# 强制等待
time.sleep(2)

# 点击登录
dj = driver.find_element(By.XPATH,'/html/body/div[1]/div/div[2]/ul/li[1]/a')
dj.click()
time.sleep(2)

# 输入用户名
driver.find_element(By.NAME,'username').send_keys('13811033962')
# 隐式等待
driver.implicitly_wait(2)

# 输入密码
mm=driver.find_element(By.NAME,'password')
# 输入
mm.send_keys('123456')
# 清空输入框
mm.clear()
# 再次输入
mm.send_keys('123456')
time.sleep(5)

# 点击登录按钮
# 显示等待
dl=WebDriverWait(driver,20,0.5).until(EC.presence_of_element_located((By.CSS_SELECTOR,'.finish-btn')))
dl.click()
print(dl.text)
time.sleep(5)




